// /////////////////////////////////////////////////////////////////////////////
//
// Name:            asSkyDomeComponent.cpp
// Author:          Michael Bartsch (ZCCdark203)
//
// Desc :           Binds the SkyDomeComponent class to AngelScript
//
// License:         Copyright (C) 2009 Michael Bartsch and Contributors
//
//                  This program is free software: you can redistribute it
//                  and/or modify it under the terms of the zlib/libpng License.
//                  See main.cpp for conditions of distribution and use.
//
// /////////////////////////////////////////////////////////////////////////////

// Include files
#include "asSkyDomeComponent.h"


#ifdef __COMPILE_WITH_ANGELSCRIPT__

#include "../../ScriptHelper.h"
#include "asSceneComponent.h"

#include "../../../components/scene/SkyDomeComponent.h"


//! Reference factory for the SkyDomeComponent class.
SkyDomeComponent* createSkyDomeComponent(Entity *parent)
{
    return new SkyDomeComponent(parent);
}

//! Reference factory for the SkyDomeComponent class.
SkyDomeComponent* createSkyDomeComponent(Entity *parent, u32 hRes, u32 vRes, f32 texturePerc,
                                         f32 spherePerc, f32 radius)
{
    return new SkyDomeComponent(parent, hRes, vRes, texturePerc, spherePerc, radius);
}

//! Reference factory for the SkyDomeComponent class.
SkyDomeComponent* createSkyDomeComponent(Entity *parent, const std::string &fileName,
                                         u32 hRes, u32 vRes, f32 texturePerc, f32 spherePerc,
                                         f32 radius)
{
    return new SkyDomeComponent(parent, fileName, hRes, vRes, texturePerc, spherePerc, radius);
}

//! Binds the SkyDomeComponent class to AngelScript.
void bindSkyDomeComponent(asIScriptEngine *engine)
{
    // Forward declarations.
    int r;

    // Bind SkyDomeComponent class.
    r = engine->RegisterObjectType("SkyDomeComponent", sizeof(SkyDomeComponent), asOBJ_REF); assert(r >= 0);

    // Bind inherited functions.
    bindSceneComponentBase<SkyDomeComponent>(engine, "SkyDomeComponent");

    // Set SkyDomeComponent behaviour.
    r = engine->RegisterObjectBehaviour("SkyDomeComponent", asBEHAVE_FACTORY, "SkyDomeComponent@ f(Entity @+)",
                                        asFUNCTIONPR(createSkyDomeComponent, (Entity*), SkyDomeComponent*),
                                        asCALL_CDECL); assert(r >= 0);
    r = engine->RegisterObjectBehaviour("SkyDomeComponent", asBEHAVE_FACTORY, "SkyDomeComponent@ f(Entity @+, " \
                                        "u32, u32, f32, f32, f32)",
                                        asFUNCTIONPR(createSkyDomeComponent, (Entity*, u32, u32, f32, f32, f32),
                                        SkyDomeComponent*), asCALL_CDECL); assert(r >= 0);
    r = engine->RegisterObjectBehaviour("SkyDomeComponent", asBEHAVE_FACTORY, "SkyDomeComponent@ f(Entity @+, " \
                                        "const string &in, u32, u32, f32, f32, f32)",
                                        asFUNCTIONPR(createSkyDomeComponent, (Entity*, const std::string&,
                                        u32, u32, f32, f32, f32), SkyDomeComponent*), asCALL_CDECL); assert(r >= 0);

    r = engine->RegisterObjectMethod("SkyDomeComponent", "SkyDomeComponent& opAssign(const SkyDomeComponent &in)",
                                     asFUNCTION(assignT<SkyDomeComponent>), asCALL_CDECL_OBJFIRST); assert(r >= 0);
}

#endif // __COMPILE_WITH_ANGELSCRIPT__

// End of File
